/**
 * v-hasPermi 操作权限处理
 */

import { checkPermi } from './utils'

export default {
  mounted(el: HTMLElement, binding: { value: UserPermissions }) {
    const { value } = binding
    if (!checkPermi(value)) {
      el.parentNode && el.parentNode.removeChild(el)
    }
  }
}
